from Common.MTurk.BaseParams import BaseParams


class GetAccountBalanceParams(BaseParams):
    """
    The GetAccountBalance operation retrieves the amount of money in your Amazon Mechanical Turk account. 
    """
    
    def __init__(self):
        BaseParams.__init__(self, 'GetAccountBalance') #operation
        
        

if __name__ == "__main__":
    chp = GetAccountBalanceParams()
    print chp.parameters
    
    
"""
Error:
<?xml version="1.0"?>
<Response>
    <Errors>
        <Error>
            <Code>InvalidParameterValue</Code>
            <Message>
            Value (GetAccountBalance++++) for parameter Action is invalid. Invalid or illegal XML character specified
            </Message>
        </Error>
    </Errors>
    <RequestID>9453ca57-8b7b-42fa-9e6c-9cc1c6d34d3f</RequestID>
</Response>
"""

"""
Correct:
<?xml version="1.0" ?>
<GetAccountBalanceResponse>
    <OperationRequest>
        <RequestId>65257e8a-339a-4d3d-bd9b-4206ccbf9ea6</RequestId>
    </OperationRequest>
    <GetAccountBalanceResult>
        <Request>
            <IsValid>True</IsValid>
        </Request>
        <AvailableBalance>
            <Amount>10000.000</Amount>
            <CurrencyCode>USD</CurrencyCode>
            <FormattedPrice>$10,000.00</FormattedPrice>
        </AvailableBalance>
    </GetAccountBalanceResult>
</GetAccountBalanceResponse>
"""